<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
using System;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using System.Xml;
using System.Reflection;

namespace <xsl:value-of select="Schema/@NameSpace" />
{
	public class <xsl:value-of select="Schema/@StoreProcedureName" /> : DataAccessBase
	{
		public <xsl:value-of select="Schema/@StoreProcedureName" />()
		{
			base.InitCommand("<xsl:value-of select="Schema/@StoreProcedureName" />");
			ConfigParameter();
		}
		<xsl:for-each select="Schema/Columns">
		private SqlParameter param<xsl:value-of select="COLUMN_NAME" />;
		public <xsl:value-of select="concat(LANGUAGE_TYPE,' ',COLUMN_NAME)" />
		{
			get
			{
				return (<xsl:value-of select="LANGUAGE_TYPE" />)param<xsl:value-of select="COLUMN_NAME" />.Value;
			}
			set
			{
				param<xsl:value-of select="COLUMN_NAME" />.Value = value;
			}
		}
		</xsl:for-each>
		public void ConfigParameter()
		{<xsl:for-each select="Schema/Columns">
			//--------------------------------------------------------
			this.param<xsl:value-of select="COLUMN_NAME" /> = new SqlParameter();
			this.param<xsl:value-of select="COLUMN_NAME" />.ParameterName = "@<xsl:value-of select="COLUMN_NAME" />";
			this.param<xsl:value-of select="COLUMN_NAME" />.SqlDbType = <xsl:value-of select="DB_TYPE" />;
			this.param<xsl:value-of select="COLUMN_NAME" />.Size = <xsl:value-of select="LENGTH" />;
			this.param<xsl:value-of select="COLUMN_NAME" />.Direction = ParameterDirection.<xsl:choose>
				<xsl:when test="COLUMN_TYPE='1'">Input</xsl:when>
				<xsl:when test="COLUMN_TYPE='2'">Output</xsl:when>
				<xsl:when test="COLUMN_TYPE='5'">ReturnValue</xsl:when>
			</xsl:choose>;
			this.param<xsl:value-of select="COLUMN_NAME" />.Value = DBNull.Value;
			base.sqlComm.Parameters.Add(this.param<xsl:value-of select="COLUMN_NAME" />);</xsl:for-each>
		}
	}
}</xsl:template>
</xsl:stylesheet>